using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace CoolStuff
{
	public delegate void RefreshPictureDelegate(Image im);
	public class PicDoc
	{
		public event RefreshPictureDelegate refreshPicture;
		string url = string.Empty;

		public string Url
		{
			get { return url; }
			set { url = value; }
		}
		PSize picSize = null;
		Image im = null;


		public Image Image
		{
			get { return im; }
			set
			{
				im = value;
				refreshPicture(im);
			}
		}
		public PSize PicSize
		{
			get { return picSize; }
			set { picSize = value; }
		}
		public Image getSizedImage(Image im)
		{
			return new Bitmap(im, picSize.getBaseSize);
		}

	}

	public class PSize
	{
		Size pSize;

		public Size getBaseSize
		{
			get { return pSize; }
			set { pSize = value; }
		}

		public int Width
		{
			get { return pSize.Width; }
			set { pSize.Width = value; }
		}
		public int Height
		{
			get { return pSize.Height; }
			set { pSize.Height = value; }
		}
		public PSize(int width, int height)
		{
			pSize.Width = width;
			pSize.Height = height;

		}
		public override string ToString()
		{
			return string.Format("{0}X{1}", pSize.Width, pSize.Height);
		}

	}
}
